package controllers;

import models.DotBook;

@CRUD.For(DotBook.class)
public class DotBooks extends CRUD {

	public static void savadotbook(String booname,String author,String pree,String isbn){
		int state = 0 ;
		String uid = session.get("userid");
		if(uid == null || ("").equals(uid)){
			state = 1 ;
			render(state);
		}else{
			DotBook dotbook = new DotBook();
			dotbook.booname = booname ;
			dotbook.author = author ;
			dotbook.press = pree ;
			dotbook.isbn = isbn ;
			dotbook.memid = Long.parseLong(uid);
			dotbook.save();
			state = 2 ;
			render(state);
		}
	}
}
